package cn.bdqn.controller;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("/user")
public class UserController {
    @Resource
    RedisTemplate redisTemplate;

    @GetMapping("put/{uname}")
    public String put(@PathVariable String uname){
        redisTemplate.boundValueOps("username").set(uname);
        return "succes";
    }
}
